import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },

  {
    path: '/detail',
    name: 'detail',
    component: () => import(/* webpackChunkName: "about" */ '../views/DetailView.vue')
  },

  {
    path: '/customer',
    name: 'customer',
    component:  () => import(/* webpackChunkName: "about" */ '../views/CustomerView.vue'),
    children:[
      {
        path: '/customer/order/add-new',
        name: 'OrderAddNew',
        component: () => import(/* webpackChunkName: "about" */ '../views/customers/OrderAddNewView')
      },
      {
        path: '/customer/orders',
        name: 'OrderList',
        component: () => import(/* webpackChunkName: "about" */ '../views/customers/OrderListView.vue')
      },
      {
        path: '/customer/info',
        name: 'CustomerInfoStandard',
        component: () => import(/* webpackChunkName: "about" */ '../views/customers/CustomerInfoStandardView.vue')
      },
      {
        path: '/customer/info-update',
        name: 'CustomerInfoUpdate',
        component: () => import(/* webpackChunkName: "about" */ '../views/customers/CustomerInfoUpdateView.vue')
      },
      {
        path: '/customer/password-update',
        name: 'CustomerPasswordUpdate',
        component: () => import(/* webpackChunkName: "about" */ '../views/customers/CustomerPasswordUpdateView.vue')
      },
    ]
  },



]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
